package com.pi.pro.xcmg.am.was.web.report;

/**
 *
 */

import com.pi.pro.xcmg.am.common.vo.report.*;
import com.pi.pro.xcmg.am.common.vo.sys.Result;
import com.pi.wms.service.KanbanReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.*;


/**
 * 报表(LED屏) 功能
 */
@Slf4j
@RestController("reportTransReportContrller")
@RequestMapping("/api/wms/xcmg/report/kanban/trans")
public class ReportTransController {

    @Autowired
    private KanbanReportService kanbanReportService;

    @RequestMapping(value="/monthsummary",method = RequestMethod.POST)
    @ResponseBody
    public Result monthsummary(@RequestBody ReportQueryDto queryParams){
        String m = "";   //
        Map<String, Object> query = new HashMap<>();
        query.put("divisioncode", queryParams.getDivisioncode());
        //
        List<TransMonthSummaryReportDto> lines = null;
        //lines = AvicWuhanReportWorkSupport.mockTransMonthSummaryReport();

        lines =kanbanReportService.summaryTransMonthData(query);

        return new Result().success().data(lines);
    }


    @RequestMapping(value="/dailysummary",method = RequestMethod.POST)
    @ResponseBody
    public Result dailysummary(@RequestBody ReportQueryDto queryParams){
        String m = "";   //
        Map<String, Object> query = new HashMap<>();
        query.put("divisioncode", queryParams.getDivisioncode());
        //
        TransDailySummaryReportDto line = null;
        line =kanbanReportService.summaryTransTaskDailyReportDto(query);

        return new Result().success().data(line);
    }

    @RequestMapping(value="/dailyconssummary",method = RequestMethod.POST)
    @ResponseBody
    public Result dailyConsSummary(@RequestBody ReportQueryDto queryParams){
        String m = "";   //
        Map<String, Object> query = new HashMap<>();
        query.put("divisioncode", queryParams.getDivisioncode());
        //
        List<TransConsDailySummaryReportDto> lines = null;
        lines=new ArrayList<>();
        /**
        TransConsDailySummaryReportDto d01=new TransConsDailySummaryReportDto();
        d01.setReportdate("2025-07-07");
        d01.setReceivepaltotal(80);
        d01.setShippaltotal(310);
        d01.setReceivematerialtotal(40);
        d01.setShipmaterialtotal(303);
        lines.add(d01);

        TransConsDailySummaryReportDto d02=new TransConsDailySummaryReportDto();
        d02.setReportdate("2025-07-06");
        d02.setReceivepaltotal(110);
        d02.setShippaltotal(410);
        d02.setReceivematerialtotal(340);
        d02.setShipmaterialtotal(103);
        lines.add(d02);

        TransConsDailySummaryReportDto d03=new TransConsDailySummaryReportDto();
        d03.setReportdate("2025-07-05");
        d03.setReceivepaltotal(180);
        d03.setShippaltotal(110);
        d03.setReceivematerialtotal(40);
        d03.setShipmaterialtotal(193);
        lines.add(d03);

        TransConsDailySummaryReportDto d04=new TransConsDailySummaryReportDto();
        d04.setReportdate("2025-07-04");
        d04.setReceivepaltotal(44);
        d04.setShippaltotal(210);
        d04.setReceivematerialtotal(30);
        d04.setShipmaterialtotal(373);
        lines.add(d04);

        TransConsDailySummaryReportDto d05=new TransConsDailySummaryReportDto();
        d05.setReportdate("2025-07-03");
        d05.setReceivepaltotal(2);
        d05.setShippaltotal(410);
        d05.setReceivematerialtotal(6);
        d05.setShipmaterialtotal(243);
        lines.add(d05);
        **/
        lines =kanbanReportService.summaryTransConsTaskDailyReportData(query);

        return new Result().success().data(lines);
    }


}
